\documentclass{article}

\usepackage{cite}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{subcaption}
\usepackage{hyperref}
\usepackage{color}
\usepackage{placeins}
\usepackage{epstopdf}
\graphicspath{{Figures/}}

\begin{document}
\title{Lab 5: Color Constancy}
\author{Alexandra Booth \and Glenn Sweeney}

% make the title area
\maketitle

% make introduction
\section{Introduction}

The human observer is a very difficult system to model.
As the light source illuminating a sample changes, the amount of energy in different parts of the spectrum can change dramatically.
The human visual system has a remarkable ability to adapt to these changes through a process called chromatic adaptation.
However, even with this process, which can correct for overall shifts in color, there is still some general shift in colors.
This shift may not always be the same for each color and is dependent on the reflectance spectra.

A Gretag MacBeth Color Checker is a color target that can be used for color analysis such as this.
It has 24 patches of unique colors that allow for a range of colors to be investigated.
Some of these colors include: dark skin, light skin, blue sky, foliage, blue flower, bluish green, orange, purplish blue, moderate red, purple, and yellow green.
Despite the range in color, it still does not include a complete distribution across the color space.
It is always better to use a larger collection of samples and a larger distribution of colors.
However, for overall analysis, the Gretag MacBeth color checker can still be useful.

Color differences can either be measured directly using an instrument such as a colorimeter, or computed from reflectances and light sources.
Because of this, many different methods exist to find the color differences.
After measurement however, each process eventually merges into a single workflow.
Each color patch has different measured XYZ values under different light sources.
From this point, color differences need to be calculated.

There are two different models for color difference calculation.
The first is to discount the chromatic adaptation of the human visual system, and compute the differences for an unadapted viewer.
This calculation will take into account the actual spectral differences between the light source.
The results best model the color difference percieved by an observer immediately after the illuminating light source is changed.

However, more often, we wish to consider the color difference observed {\it after} the observer adapts to the light source.
In most circumstances, the human visual system will adapt to its viewing conditions to percieve the color of the light source as neutral.
This behavior, called chromatic adaptation, means that overall shifts in color from light sources are generally neutralized.
Instead, only smaller, irregular differences within a set of patches remains.
This calculation is done by applying a chromatic adaptation model to the second set of measurements before calculating color differences.

The most common color space for color difference calculation today is the L*a*b* coordinate space.
This is a uniform color space specificially designed for calculation of color differences under standard viewing conditions.
L*a*b* also has a chromatic adaptation step, so it can be helpful for comparing samples viewed under different lighting conditions.
The origin of L*a*b* space is neutral.
As the distance from the origin increases in the a*b* plane, chroma increases.
When examining the space certain visual color are identified in a general sectios of these axes.
The +a* is considered reddish while the -a* is considered blue-green.
The +b* is considered yellowish while the -b* is considered blue.
The -a* and +b* is considered greenish while the +a* and -b* is considered violet.

There are many different distance metrics that can be used in the L*a*b* space to calculate color difference.
Each metric attempts to match the human observer's perception of color difference.
However, this is a very difficult thing to do, and because of it, each color metric has benefits and drawbacks.
As a result, different metrics are preferred for different reasons.

In this laboratory, several light sources and distance metrics are compared when viewing the Gretag MacBeth color chart.

\section{Procedure}

In this lab, the spectral reflectances of the Gretag MacBetch color checker patches were provided.
The measurement geometry of these measurements is unknown.
In addition, different illuminant curves were provided.
These illuminants include D50, D75, and A.
The spectral reflectances were modeled as if initially viewed under one of the light sources and then viewed under a second by using a MATLAB program provided.
For each patch and for each illuminant, the L*a*b* values were returned as well as two different change in color results ($\Delta E*_{ab}$ and $\Delta E_{94}$).
For this laboratory, it was chosen to account for absoerver color adaptation by changing the white point during the L*a*b* calculation.
The L*a*b* values were plotted as vector plots for easier visual analysis.

\section{Results}

Figure \ref{fig:d50vsa} shows the vector plot of the patches illuminated under illuminant D50 and then viewed under illuminant A.
It appears that most patches under went very little color shift.
The patches that exhibited a color shift were in the higher chroma red-yellow region and the higher chroma blue region.
The higher chroma red and red-yellow colors tended towards a yellow shift.
The higher chroma blue colors tended towards a green shift.

Figure \ref{fig:d75vsa} shows the vector plot of the patches illuminated under illuminant D75 and then viewed under illuminant A.
It appears that more patches underwent a noticeable color shift here than those in figure \ref{fig:d50vsa}.
The red shift towards blue and the blue shift towards green is still exhibited.
What also appears to happen is that the yellow shifts towards the red-yellow and the green-yellow shifts towards yellow.
Neutrals remain mostly unchanged.

Figure \ref{fig:d75vsd50} shows the vector plot of the patches illuminated under illuminant D75 and then viewed under illuminant D50.
There is very little change for the patches between these sources.
The only notible change is the slight shift of the blue-purple towards the blue.

In the appendix \ref{app:tables} are the tables containing the exact values used to ake the vector plot.
The color difference values ($\Delta E*_{ab}$ and $\Delta E_{94}$) are also listed in the tables.
It can be seen that the larger the $\Delta E*_{ab}$ or $\Delta E_{94}$, the greater the shift that was plotted.

\begin{figure}
\centering
\begin{subfigure}{.5\textwidth}
  \centering
\includegraphics[width=\textwidth]{d50_vs_a.eps}
\caption{D50 vs A}
\label{fig:d50vsa}
\end{subfigure}%
\begin{subfigure}{.5\textwidth}
  \centering
 \includegraphics[width=\textwidth]{d75_vs_a.eps}
\caption{D75 vs. A}
\label{fig:d75vsa}
\end{subfigure}
\caption{L*a*b* vector plots for the comparison of illuminant D50 versus illuminant A and of illuminant D75 versus illuminant A for the 24 color patches.}
\label{fig:test}
\end{figure}

\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{d75_vs_d50.eps}
\caption{L*a*b* vector plots for the comparison of illuminant D50 versus illuminant D75 for the 24 color patches.}
\label{fig:d75vsd50}
\end{figure}

\FloatBarrier

\section{Analysis and Conclusions}

In this lab, we examined the theoretical color differences for the Gretag MacBeth color chart when viewed under different lighting conditions.
Different error metrics were used to examine these differences, and the results of each were compared.
Generally, the $\Delta E_{94}$ metric performs better than the $\Delta E*_{ab}$ metric, because it accounts for more visual effects.
In this lab, it was not possible to determine which metric was better, because no information about the human observer's percieved color difference was measured or provided.
The only comparisons that can be made is that at least for this data set $\Delta E_{94}$ consistently calculates a smaller color difference than $\Delta E*_{ab}$.

As expected, moving from any of the D illuminants to illuminant A caused larger shifts than moving amongst the D illuminants.
This is most ikely because of the very different nature of the light sources.
Even though the visual system adapts chromatically, not every aspect of the source can be accounted for.

Of considerable interest is the fact that moving from illuminant D75 to illuminat D50 actually increased the blueness of the overall patches. This is in part due to the chromatic adaptation model, but it cannot fully explain it.

Overall, color reproduction seemed very good across all light sources, because there were no patches that had drastic changes in perception.
This is expected, because the color chart was specifically designed to be robust to illuminant changes.

\newpage
\appendix

\FloatBarrier

\section{\\Data Tables} \label{app:tables}

\begin{table}[]
\centering
\caption{Table of the program's output values for the D50 vs. A comparison.}
\label{tbl:d50vsa}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|}
\hline
 & \multicolumn{3}{|c|}{$D_{50}$} & \multicolumn{3}{|c|}{A} & \multicolumn{2}{|c|}{Color Differences} \\ \hline
Color Patches & L* & a* & b* & L* & a* & b* & $\Delta E*_{ab}$ & $\Delta E_{94}$ \\ \hline
Dark Skin & 36.21 & 15.05 & 16.07 & 38.09 & 15.49 & 19.38 & 3.83 & 2.72 \\ \hline
Light Skin & 66.11 & 16.02 & 17.70 & 68.12 & 17.79 & 21.49 & 4.64 & 2.91 \\ \hline
Blue Sky & 50.33 & -7.32 & -21.63 & 48.53 & -9.50 & -24.49 & 4.01 & 2.59 \\ \hline
Foliage & 41.23 & -10.39 & 23.62 & 41.18 & -8.81 & 24.14 & 1.66 & 1.20 \\ \hline
Blue Flower & 55.95 & 4.53 & -23.79 & 55.10 & 2.93 & -25.10 & 2.23 & 1.63 \\ \hline
Bluish Green & 70.61 & -31.74 & 1.71 & 68.08 & -30.71 & -0.41 & 3.45 & 2.93 \\ \hline
Orange & 60.45 & 37.52 & 61.38 & 65.30 & 35.21 & 70.12 & 10.26 & 5.91 \\ \hline
Purplish Blue & 40.90 & 2.19 & -43.75 & 38.16 & -5.58 & -48.06 & 9.29 & 5.56 \\ \hline
Moderate Red & 51.70 & 45.01 & 16.62 & 56.31 & 43.96 & 24.27 & 8.98 & 6.34 \\ \hline
Purple & 29.66 & 18.93 & -23.57 & 30.19 & 15.89 & -25.39 & 3.59 & 2.50 \\ \hline
Yellow Green & 70.65 & -16.45 & 60.10 & 71.01 & -13.02 & 62.99 & 4.50 & 2.17 \\ \hline
Orange Yellow & 69.97 & 23.74 & 67.49 & 73.79 & 22.42 & 74.56 & 8.14 & 4.43 \\ \hline
Blue & 29.61 & 9.28 & -53.39 & 26.05 & -2.12 & -57.70 & 12.70 & 7.42 \\ \hline
Green & 53.73 & -34.95 & 36.68 & 52.16 & -31.36 & 36.14 & 3.96 & 2.22 \\ \hline
Red & 40.33 & 53.92 & 30.26 & 46.22 & 53.51 & 40.33 & 11.67 & 7.53 \\ \hline
Yellow & 79.70 & 9.32 & 81.17 & 82.52 & 11.57 & 88.18 & 7.88 & 3.27 \\ \hline
Magenta & 51.54 & 44.55 & -14.60 & 55.03 & 43.23 & -10.46 & 5.57 & 4.16 \\ \hline
Cyan & 51.12 & -33.65 & -25.18 & 46.85 & -35.62 & -29.89 & 6.65 & 4.79 \\ \hline
Neutral 9.5 & 96.32 & 0.36 & 3.02 & 96.47 & 0.92 & 4.67 & 1.75 & 1.54 \\ \hline
Neutral 8 & 81.27 & -0.25 & 0.45 & 81.27 & -0.23 & 1.09 & 0.64 & 0.62 \\ \hline
Neutral 6.5 & 65.51 & -0.17 & -0.26 & 65.48 & -0.33 & 0.00 & 0.31 & 0.31 \\ \hline
Neutral 5 & 50.76 & -0.73 & -0.09 & 50.70 & -0.87 & 0.05 & 0.21 & 0.20 \\ \hline
Neutral 3.5 & 34.43 & -0.77 & -0.36 & 34.34 & -0.89 & -0.36 & 0.15 & 0.14 \\ \hline
Neutral 2 & 19.25 & -0.13 & -0.84 & 19.20 & -0.22 & -0.97 & 0.17 & 0.16 \\ \hline
\end{tabular}
\end{table}

\begin{table}[!t]
\centering
\caption{Table of the program's output values for the D75 vs. A comparison.}
\label{tbl:d75vsa}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|}
\hline
 & \multicolumn{3}{|c|}{$D_{75}$} & \multicolumn{3}{|c|}{$A$} & \multicolumn{2}{|c|}{Color Differences} \\ \hline
Color Patches & L* & a* & b* & L* & a* & b* & $\Delta E*_{ab}$ & $\Delta E_{94}$ \\ \hline
Dark Skin & 35.38 & 12.86 & 14.71 & 38.09 & 15.49 & 19.38 & 6.00 & 3.97 \\ \hline
Light Skin & 65.25 & 12.79 & 16.44 & 68.12 & 17.79 & 21.49 & 7.66 & 4.67 \\ \hline
Blue Sky & 51.22 & -3.76 & -20.17 & 48.53 & -9.50 & -24.49 & 7.67 & 5.20 \\ \hline
Foliage & 41.00 & -12.17 & 23.65 & 41.18 & -8.81 & 24.14 & 3.40 & 2.38 \\ \hline
Blue Flower & 56.54 & 7.35 & -22.97 & 55.10 & 2.93 & -25.10 & 5.11 & 3.82 \\ \hline
Bluish Green & 71.50 & -31.22 & 4.26 & 68.08 & -30.71 & -0.41 & 5.81 & 4.66 \\ \hline
Orange & 58.18 & 33.70 & 57.81 & 65.30 & 35.21 & 70.12 & 14.30 & 8.00 \\ \hline
Purplish Blue & 42.43 & 10.15 & -41.38 & 38.16 & -5.58 & -48.06 & 17.61 & 10.88 \\ \hline
Moderate Red & 49.80 & 41.80 & 13.15 & 56.31 & 43.96 & 24.27 & 13.06 & 8.88 \\ \hline
Purple & 29.72 & 22.61 & -24.72 & 30.19 & 15.89 & -25.39 & 6.77 & 4.11 \\ \hline
Yellow Green & 70.07 & -21.06 & 60.90 & 71.01 & -13.02 & 62.99 & 8.36 & 4.33 \\ \hline
Orange Yellow & 68.04 & 19.75 & 64.68 & 73.79 & 22.42 & 74.56 & 11.74 & 6.28 \\ \hline
Blue & 31.63 & 18.52 & -49.80 & 26.05 & -2.12 & -57.70 & 22.79 & 13.33 \\ \hline
Green & 54.01 & -37.88 & 38.83 & 52.16 & -31.36 & 36.14 & 7.29 & 3.10 \\ \hline
Red & 37.75 & 49.64 & 25.78 & 46.22 & 53.51 & 40.33 & 17.27 & 10.60 \\ \hline
Yellow & 78.11 & 3.52 & 80.20 & 82.52 & 11.57 & 88.18 & 12.16 & 5.83 \\ \hline
Magenta & 50.40 & 44.12 & -17.56 & 55.03 & 43.23 & -10.46 & 8.53 & 6.06 \\ \hline
Cyan & 52.95 & -29.13 & -21.09 & 46.85 & -35.62 & -29.89 & 12.52 & 7.55 \\ \hline
Neutral 9.5 & 96.24 & -0.41 & 3.23 & 96.47 & 0.92 & 4.67 & 1.97 & 1.79 \\ \hline
Neutral 8 & 81.27 & -0.37 & 0.57 & 81.27 & -0.23 & 1.09 & 0.54 & 0.53 \\ \hline
Neutral 6.5 & 65.52 & -0.11 & -0.19 & 65.48 & -0.33 & 0.00 & 0.30 & 0.30 \\ \hline
Neutral 5 & 50.79 & -0.66 & 0.01 & 50.70 & -0.87 & 0.05 & 0.23 & 0.23 \\ \hline
Neutral 3.5 & 34.46 & -0.66 & -0.27 & 34.34 & -0.89 & -0.36 & 0.27 & 0.26 \\ \hline
Neutral 2 & 19.28 & 0.00 & -0.82 & 19.20 & -0.22 & -0.97 & 0.28 & 0.28 \\ \hline
\end{tabular}
\end{table}

\begin{table}[!t]
\centering
\caption{Table of the program's output values for the D75 vs. D50 comparison.}
\label{tbl:d75vsd50}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|}
\hline
 & \multicolumn{3}{|c|}{$D_{75}$} & \multicolumn{3}{|c|}{$D_{50}$} & \multicolumn{2}{|c|}{Color Differences} \\ \hline
Color Patches & L* & a* & b* & L* & a* & b* & $\Delta E*_{ab}$ & $\Delta E_{94}$ \\ \hline
Dark Skin & 35.38 & 12.86 & 14.71 & 38.09 & 15.05 & 16.07 & 2.71 & 1.65 \\ \hline
Light Skin & 65.25 & 12.79 & 16.44 & 68.12 & 16.02 & 17.70 & 3.57 & 2.19 \\ \hline
Blue Sky & 51.22 & -3.76 & -20.17 & 48.53 & -7.32 & -21.63 & 3.96 & 2.79 \\ \hline
Foliage & 41.00 & -12.17 & 23.65 & 41.18 & -10.39 & 23.62 & 1.79 & 1.22 \\ \hline
Blue Flower & 56.54 & 7.35 & -22.97 & 55.10 & 4.53 & -23.79 & 2.99 & 2.23 \\ \hline
Bluish Green & 71.50 & -31.22 & 4.26 & 68.08 & -31.74 & 1.71 & 2.76 & 1.98 \\ \hline
Orange & 58.18 & 33.70 & 57.81 & 65.30 & 37.52 & 61.38 & 5.69 & 2.69 \\ \hline
Purplish Blue & 42.43 & 10.15 & -41.38 & 38.16 & 2.19 & -43.75 & 8.44 & 5.26 \\ \hline
Moderate Red & 49.80 & 41.80 & 13.15 & 56.31 & 45.01 & 16.62 & 5.10 & 2.72 \\ \hline
Purple & 29.72 & 22.61 & -24.72 & 30.19 & 18.93 & -23.57 & 3.85 & 1.88 \\ \hline
Yellow Green & 70.07 & -21.06 & 60.90 & 71.01 & -16.45 & 60.10 & 4.71 & 2.26 \\ \hline
Orange Yellow & 68.04 & 19.75 & 64.68 & 73.79 & 23.74 & 67.49 & 5.25 & 2.60 \\ \hline
Blue & 31.63 & 18.52 & -49.80 & 26.05 & 9.28 & -53.39 & 10.11 & 5.85 \\ \hline
Green & 54.01 & -37.88 & 38.83 & 52.16 & -34.95 & 36.68 & 3.64 & 1.13 \\ \hline
Red & 37.75 & 49.64 & 25.78 & 46.22 & 53.92 & 30.26 & 6.71 & 3.25 \\ \hline
Yellow & 78.11 & 3.52 & 80.20 & 82.52 & 9.32 & 81.17 & 6.09 & 3.05 \\ \hline
Magenta & 50.40 & 44.12 & -17.56 & 55.03 & 44.55 & -14.60 & 3.21 & 2.07 \\ \hline
Cyan & 52.95 & -29.13 & -21.09 & 46.85 & -33.65 & -25.18 & 6.37 & 2.98 \\ \hline
Neutral 9.5 & 96.24 & -0.41 & 3.23 & 96.47 & 0.36 & 3.02 & 0.80 & 0.76 \\ \hline
Neutral 8 & 81.27 & -0.37 & 0.57 & 81.27 & -0.25 & 0.45 & 0.17 & 0.17 \\ \hline
Neutral 6.5 & 65.52 & -0.11 & -0.19 & 65.48 & -0.17 & -0.26 & 0.09 & 0.09 \\ \hline
Neutral 5 & 50.79 & -0.66 & 0.01 & 50.70 & -0.73 & -0.09 & 0.12 & 0.12 \\ \hline
Neutral 3.5 & 34.46 & -0.66 & -0.27 & 34.34 & -0.77 & -0.36 & 0.14 & 0.14 \\ \hline
Neutral 2 & 19.28 & 0.00 & -0.82 & 19.20 & -0.13 & -0.84 & 0.14 & 0.14 \\ \hline
\end{tabular}
\end{table}

\end{document}
